package data.structure.linear.queue;


import data.structure.linear.List;
import data.structure.linear.linkedList.SingleLinkedList;


/**
 * @Author douhy
 * @description 手写队列(链表实现)
 * @date 22/01/25
 */
public class Queue<E> {
    private List<E> list = new SingleLinkedList<E>();

    public int size() {
        return list.size();
    }

    public boolean isEmpty() {
        return list.isEmpty();
    }

    public void clear() {
        list.clear();
    }

    public void enQueue(E data) {
        list.add(data);
    }

    public E deQueue() {
        return list.remove(0);
    }

    public E front(){
        return list.get(0);
    }
}
